import norm.reference.*
class BootStrap {

    def init = { servletContext ->
		environments {
               development {
                    def user1 = new User(username:"kylehaw", password:"123", email:"kylehaw@gmail.com", active:1, userLevel:"admin")
					def user2 = new User(username:"user", password:"123", email:"kylehaw@gmail.com", active:1, userLevel:"user")
					def user3 = new User(username:"research", password:"123", email:"kylehaw@gmail.com", active:1, userLevel:"research")
					def user4 = new User(username:"faculty", password:"123", email:"kylehaw@gmail.com", active:1, userLevel:"faculty")
					user1.save()
					user2.save()
					user3.save()			
					user4.save()	
					
					def comparisonGroup1 = new ComparisonGroup(name:"TestGroup")
					comparisonGroup1.save()
					
					def division1 = new Division(divisionCode:"NHS", divisionName:"Natural and Health Sciences")
					def division2 = new Division(divisionCode:"PGS", divisionName:"Professional and Graduate Studies")
					division1.save()
					division2.save()
					
					def department1 = new Department(departmentCode:"CSC", departmentName:"Computer Science", division:division1)
					def department2 = new Department(departmentCode:"MAT", departmentName:"Mathematics", division:division2)
					department1.save()
					department2.save()
					
					division1.setComparisonGroup(comparisonGroup1)
					division2.setComparisonGroup(comparisonGroup1)
					division1.save()
					division2.save()
					comparisonGroup1.save()
					print comparisonGroup1.divisionFiltersToString()
					
               }
               production {}
		
		
    }
    def destroy = {
    }
}
}